<extend name="Application/Admin/View/Layout/application.html" />

<block name="css">
    <style>
        #page1{

        }
        #page2 {
            display: none;
        }
    </style>
</block>


<block name="content">
    <div class="row">
        <div class="col-md-12">

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="bs-example bs-example-tabs" data-example-id="togglable-tabs">
                            <ul id="myTabs" class="nav nav-tabs" role="tablist">
                                <li role="presentation" class="active">
                                    <a href="#home" id="category_tab" role="tab" data-toggle="tab" aria-controls="home" aria-expanded="true">添加栏目</a>
                                </li>
                                <li role="presentation">
                                    <a href="#profile" role="content" id="content" data-toggle="tab" aria-controls="profile">栏目内容</a>
                                </li>
                            </ul>
                        </div>

                        <div class="panel-body">
                            <div class="panel-body">
                                <form class="form-horizontal col-sm-12" method="post" action="{{:U('store')}}">
                                    <div id="page1">

                                        <input type="hidden" name="id" value="{{$c.id}}">
                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">父栏目</label>
                                            <div class="col-sm-6">

                                                <select class="form-control" name="parent_id">
                                                    <volist name="categories" id="category">
                                                        <option value="{{$category.id}}" >{{$category.name}}</option>
                                                    </volist>
                                                </select>

                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">名称</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="name" id="name" placeholder="" value="">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">拼音</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="pingyin" id="pingyin" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">类型</label>
                                            <div class="col-sm-6">
                                                <div class="radio">
                                                    <label>
                                                        <input type="radio" name="type" id="optionsRadios1" value="1" checked>
                                                        封面
                                                    </label>
                                                    <div class="radio">
                                                        <label>
                                                            <input type="radio" name="type" id="optionsRadios1" value="2" >
                                                            列表
                                                        </label>
                                                    </div>
                                                    <div class="radio">
                                                        <label>
                                                            <input type="radio" name="type" id="optionsRadios1" value="3" >
                                                            url
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="" class="col-sm-2 control-label">URL跳转地址</label>
                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="url" id="url" placeholder="">
                                            </div>
                                        </div>
                                    </div>
                                    <div id="page2">

                                        <textarea name="category_content" class="content" id="textarea"></textarea>
                                        <script src="/Public/ckeditor/ckeditor.js"></script>
                                        <script type="text/javascript" src="/Public/ckfinder/ckfinder.js"></script>
                                    </div>

                                <div class="form-group">
                                    <label for="" class="col-sm-2 control-label">是否显示</label>
                                    <div class="col-sm-6">
                                        <div class="radio" >
                                            <label>
                                                <input type="radio" name="show" id="optionsRadios1" value="1" checked>
                                                是
                                            </label>
                                            <label>
                                                <input type="radio" name="show" id="optionsRadios1" value="2" >
                                                否
                                            </label>

                                        </div>
                                    </div>
                                </div>


                                <div class="form-group" >
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-default" >添加</button>
                                        <button type="button" class="btn btn-default btn-primary" disabled id="prev">返回</button>
                                    </div>
                                </div>
                             </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</block>

<block name="js">
    <script>
        $(function () {
            var $content = $("#content");
            var $category_tab = $("#category_tab");
            var $page1 = $("#page1");
            var $page2 = $("#page2");

            $category_tab.click(function () {
                $page2.hide();
                $page1.fadeIn(300);

            })

            $content.click(function () {
                $page1.hide();
                $page2.fadeIn(300);

            })
        })

    </script>
    <script>
        CKEDITOR.replace('category_content',
                {
                    filebrowserBrowseUrl: '/Public/ckfinder/ckfinder.html',
                    filebrowserImageBrowseUrl: '/Public/ckfinder/ckfinder.html?type=Images',
                    filebrowserFlashBrowseUrl: '/Public/ckfinder/ckfinder.html?type=Flash',
                    filebrowserUploadUrl: '/Public/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                    filebrowserImageUploadUrl: '/Public/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                    filebrowserFlashUploadUrl: '/Public/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
                });
    </script>
</block>